<!--#
layout("/layouts/platform.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/platform/self/order/goods/feedback" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
    <div class="btn-group tool-button pull-right">
        <a class="btn btn-primary navbar-btn" onclick="feedOpen('${obj.id}', '1')">公开</a>
        <a class="btn btn-primary navbar-btn" onclick="feedOpen('${obj.id}', '0')">不公开</a>
    </div>
</header>
<script src="${base!}/assets/common/vendor/city-picker/js/data.86.all.js" type="text/javascript"></script>
<script src="${base!}/assets/common/vendor/city-picker/js/picker.86.js" type="text/javascript"></script>
<div class="content-wrap bg-white">
    <div class="wrapper" style="min-height:500px;top:50px;">
        <div class="panel-body" style="margin-bottom: 35px">
            <input type="hidden" name="id" value="${obj.id}">

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">订单信息</h3>
                </div>
                <div class="panel-body">
                    <div class="col-md-10 col-md-offset-1">
                        <div class="col-md-4" style="padding: 5px 0px">
                            订单编号:   <span>${obj.orderMain.id}</span>
                        </div>
                        <div class="col-md-4" style="padding: 5px 0px">
                            订单来源:   <span>${@com.aebiz.app.order.modules.models.em.OrderSourceEnum.getValue(obj.orderMain.orderSrc)}</span>
                        </div>
                        <div class="col-md-4" style="padding: 5px 0px">
                            下单时间:   <span><!--#if(!isEmpty(obj.orderMain.orderAt)){#-->${@date.getDate(obj.orderMain.orderAt)} <!--#}#--></span>
                        </div>

                        <div class="col-md-4" style="padding: 5px 0px">
                            会员昵称:   <span>${obj.accountInfo.nickname}</span>
                        </div>
                        <div class="col-md-4" style="padding: 5px 0px">
                            用户名:   <span>${obj.accountUser.loginname}</span>
                        </div>
                        <div class="col-md-4" style="padding: 5px 0px">
                            手机号码:   <span>${obj.accountUser.mobile}</span>
                        </div>
                        <div class="col-md-12" style="padding: 5px 0px">
                            商品名称:   <span>${obj.goodsMain.name}&nbsp;${obj.goodsProduct.name}</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">评价信息</h3>
                </div>
                <div class="panel-body">
                    <div class="col-md-10 col-md-offset-1">
                        <div class="col-md-12" style="padding: 5px 0px;">
                            是否对外显示:   <span>${obj.feedOpen ? "对外显示" : "不对外显示"}</span>
                        </div>
                        <div class="col-md-12" style="padding: 5px 0px;">
                            商品评分:   <span><input name="appScore" readonly value="${obj.appScore}" type="number" class="rating" min=0 max=5 step=0.5 data-size="xs" ></span>
                        </div>
                        <div class="col-md-12" style="padding: 5px 0px">
                            评价时间:   <span><!--#if(!isEmpty(obj.feedAt)){#-->${@date.getDate(obj.feedAt)} <!--#}#--></span>
                        </div>
                        <div class="col-md-12" style="padding: 5px 0px">
                            评价内容:   <span>${obj.feedNote}</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">评价图片</h3>
                </div>
                <div class="panel-body">
                    <div class="col-md-10 col-md-offset-1">
                        <!--# if(isEmpty(obj.feedImage)){ #-->
                        <span>暂无图片</span>
                        <!--# } #-->
                        <!--# var imageArr = strutil.split(obj.feedImage, ","); #-->
                        <!--# for(var image in imageArr){ #-->
                        <div id="img" class="div-img-album">
                            <div class="col-sm-6 col-md-3">
                                <a href="#" class="thumbnail">
                                    <img id="${image}"  src="${image}">
                                </a>
                            </div>
                        </div>
                        <!--#} #-->
                    </div>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">评价回复信息</h3>
                </div>
                <div class="panel-body">
                    <div class="col-md-10 col-md-offset-1">
                        <div class="col-md-12" style="padding: 5px 0px">
                            回复时间:   <span><!--#if(!isEmpty(obj.storeReplyAt)){#-->${@date.getDate(obj.storeReplyAt)} <!--#}#--></span>
                        </div>
                        <div class="col-md-12" style="padding: 5px 0px">
                            回复内容:   <span>${obj.storeReplyNote}</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="dialogFeedOpen" class="modal fade bs-modal-sm" tabindex="-2" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">确认操作</h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-xs-12" id="fendOpenConfrimInfo">

                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">${msg['globals.button.cancel']}</button>
                <button id="okFeedOpen" type="button" class="btn btn-primary" data-loading-text="操作中..">${msg['globals.button.confirm']}</button>
            </div>
        </div>
    </div>
</div>

<style>
    table .s-input{margin: auto;}
    table,table.s-table tr td,table tr th{border: 1px solid #ddd;text-align: center;vertical-align: middle;}
    .star-rating{
        display: inline-block !important;
    }
</style>

<script>
    $(document).ready(function () {
        $("input[name='appScore']").rating();
    });

    function feedOpen(id, isOpen) {
        var dialog = $("#dialogFeedOpen");
        $("#fendOpenConfrimInfo").html(isOpen=="0"?"确认不公开这条评论信息吗？":"确认公开这条评论信息吗？");
        dialog.modal("show");
        dialog.find("#okFeedOpen").off("click").on("click", function (event) {
            var btn = $(this);
            btn.button("loading");
            $.post("${base}/platform/self/order/goods/feedback/changeFeedOpen/" + id + "/" + isOpen, {}, function (data) {
                if (data.code == 0) {
                    //window.location.reload(true);
                    window.location.href = "${base}/platform/self/order/goods/feedback";
                } else {
                    Toast.error(data.msg);
                }
                btn.button("reset");
                dialog.modal("hide");
            }, "json");
        });
    }
</script>
<!--#}#-->